﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using BathhouseService.Models.SqlModels;


namespace BathhouseService.CURD.ViewModels.ServiceRecordVMs
{
    public partial class ServiceRecordTemplateVM : BaseTemplateVM
    {
        [Display(Name = "订单号")]
        public ExcelPropety OrderId_Excel = ExcelPropety.CreateProperty<ServiceRecord>(x => x.OrderId);
        [Display(Name = "使用服务")]
        public ExcelPropety ValueAddedServices_Excel = ExcelPropety.CreateProperty<ServiceRecord>(x => x.ValueAddedServicesId);
        [Display(Name = "服务人姓名")]
        public ExcelPropety ServicePersonName_Excel = ExcelPropety.CreateProperty<ServiceRecord>(x => x.ServicePersonName);
        [Display(Name = "客户姓名")]
        public ExcelPropety CustomerName_Excel = ExcelPropety.CreateProperty<ServiceRecord>(x => x.CustomerName);
        [Display(Name = "支付时间")]
        public ExcelPropety PaymentTime_Excel = ExcelPropety.CreateProperty<ServiceRecord>(x => x.PaymentTime);
        public ExcelPropety Score_Excel = ExcelPropety.CreateProperty<ServiceRecord>(x => x.Score);

	    protected override void InitVM()
        {
            ValueAddedServices_Excel.DataType = ColumnDataType.ComboBox;
            ValueAddedServices_Excel.ListItems = DC.Set<ValueAddedServices>().GetSelectListItems(LoginUserInfo?.DataPrivileges, null, y => y.Names);
        }

    }

    public class ServiceRecordImportVM : BaseImportVM<ServiceRecordTemplateVM, ServiceRecord>
    {

    }

}
